<template>
	<view>
		<uv-tabbar :value="index" :fixed="true">
			<uv-tabbar-item text="首页" icon="home" @click="dumpPage('pages/bars/index')"></uv-tabbar-item>
			<uv-tabbar-item text="订单" icon="photo" @click="dumpPage('pages/orders/index')"></uv-tabbar-item>
			<uv-tabbar-item text="数据" icon="kefu-ermai" @click="dumpPage('pages/kefu/index')"></uv-tabbar-item>
			<uv-tabbar-item text="代理" icon="kefu-ermai" @click="dumpPage('pages/agent/agent')"></uv-tabbar-item>
			<uv-tabbar-item text="我的" icon="account" @click="dumpPage('pages/bars/home')"></uv-tabbar-item>
		</uv-tabbar>
	</view>
</template>

<script>
	export default {
		name: "cu-bar",
		props: {
			index: {
				type: [Number],
				default: 0
			}
		},
		data() {
			return {
				value: 0
			};
		},
		methods: {
			isEmpty(item) {
				return uni.$my.isEmpty(item);
			},
			dumpPage(page, params, type) {
				
				type = type || 'switchTab'
				// if (page.indexOf('/bars/') === -1) {
				// 	type = 'navigateTo'
				// }
				// if (page.indexOf('/orders/') === -1) {
				// 	type = 'navigateTo'
				// }
				// if (page.indexOf('/agent/') === -1) {
				// 	type = 'navigateTo'
				// }
				console.log(page,1111111111);
				console.log(params,222222222);
				console.log(type,3333333333);
				uni.$my.dumpPage(page, params, type)
			}
		}
	}
</script>

<style>

</style>